# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=snac
pkgver=2.61
pkgrel=0
pkgdesc="Simple, minimalistic ActivityPub instance written in portable C"
url="https://codeberg.org/grunfink/snac2"
arch="all"
license="MIT"
makedepends="curl-dev openssl-dev"
install="$pkgname.pre-install"
pkgusers="snac"
pkggroups="snac"
subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://codeberg.org/grunfink/snac2/archive/$pkgver.tar.gz
	snac.initd
	"
builddir="$srcdir/snac2"
options="!check" # no test suite

build() {
	make
}

package() {
	make install \
		PREFIX="$pkgdir"/usr \
		PREFIX_MAN="$pkgdir"/usr/share/man

	install -dm750 -o snac -g snac "$pkgdir"/var/lib/snac

	install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/

	install -Dm755 "$srcdir"/snac.initd "$pkgdir"/etc/init.d/snac
}

sha512sums="
02be9ce80aa9a16fbd31ba7b0963fe71f833dc0730bef21c2eecea079670d5cb15c3f64d263544f2e48212897d0a1cdafac4cbad61b26314ac496f69e0f4213f  snac-2.61.tar.gz
8451eb37e5135b926a1a36b7f69d63cb76aa617ca3f9b9167f2284223582dcf66723ee67c51c6abc2d1605c41678d26f67ec6cb1bf920c61379dbf63f7852e1a  snac.initd
"
